The present invention relates to a semiconductor integrated circuit having a CPU (Central Processing Unit) built therein and a non-volatile memory externally attached thereto or built therein, and to a system using the semiconductor integrated circuit, the invention being preferably applicable to a semiconductor integrated circuit which particularly encrypts and protects contents such as programs and data stored in a non-volatile memory, and to a system using the same.
With a semiconductor integrated circuit (IC) such as a microcomputer or a system LSI (Large Scale Integrated circuit) having a non-volatile memory such as a flash memory (registered trademark) and a CPU mounted in a single chip, programs and data are stored in a non-volatile memory and the CPU executes the programs and uses the data. The same applies to a case where the non-volatile memory storing the programs and data is externally attached. Readout of memory is mentioned as an attack to such a semiconductor device. Although the communication protocol is concealed by encryption, programs and data stored in a non-volatile memory of a semiconductor device cannot be protected from the aforementioned attack of directly reading the memory, by encryption of information to be communicated.
A technique of concealing the communication protocol by encryption is disclosed in, for example, Japanese Patent Laid-Open No. 2007-184735 and Japanese Patent Laid-Open No. 2013-003431, and a technique of protecting programs in a built-in memory of a microcontroller by encryption is disclosed in, for example, Japanese Patent Laid-Open No. 2008-217579.
Japanese Patent Laid-Open No. 2007-184735 discloses a system which performs authentication between the main body and an accessory thereof, the system having a microcontroller provided on each of the authenticating side and the authenticated side and performing authentication of whether or not the accessory is authentic by performing encryption on the same random number, on both sides, through the use of the same cryptographic key and by matching therebetween. A configuration so as to encrypt, on the basis of another cryptographic key and identification information, the cryptographic key for encrypting the random number makes it possible to prevent an imitation made by an illegally obtained program from operating normally, whereby imitations made by simply copying the program memory can be eliminated.
Japanese Patent Laid-Open No. 2013-003431 discloses a semiconductor device which is coupled to an external device and in which sufficient security is ensured when writing data. The semiconductor device includes a unique code generating unit capable of generating a value specific to the device (unique code), and transmits the unique code to an external device. A unique code is a value specific to individual devices by, for example, production variation, and is different for each individual even if the design information has been completely cloned. The unique code can be generated using, for example, a Physically Unclonable Function (PUF). Using the received unique code, the external device performs another encryption processing on the cryptographic key for use by the semiconductor device when writing data and then transmits it to the semiconductor device. The semiconductor device obtains a cryptographic key by decrypting the encrypted cryptographic key received using a unique code of its own. The semiconductor device encrypts the data to be concealed by using the cryptographic key, and writes the data. Since the cryptographic key for writing data is encrypted by unclonable unique data, highly secure communication becomes possible between the external device and the semiconductor device.
Japanese Patent Laid-Open No. 2008-217579 discloses a microcontroller including a memory which stores an encrypted program, a decrypting block which decrypts the program, and a CPU which executes the decrypted program. Decryption information for decrypting the encrypted program is held in a register in the decrypting block in a manner physically unreadable from the CPU.